import movie.test.as.bean.TestSpring;
import movie.test.as.dao.TestSpringDao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.alibaba.fastjson.JSONObject;


public class Test {

	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-db.xml");
        TestSpringDao dao = (TestSpringDao)ctx.getBean("testSpringDao");
        TestSpring test = new TestSpring();
      
        test.setName("sssss");
        JSONObject object = (JSONObject) JSONObject.toJSON(test);
        System.out.println(object);
        dao.saveSpringTest(object);
	}

}
